[Ivy]
[>Created: Tue Jul 01 16:09:56 ICT 2014]
146EB90F8F519B27 3.17 #module
>Proto >Proto Collection #zClass
Ms0 MailComposerProcess Big #zClass
Ms0 RD #cInfo
Ms0 #process
Ms0 @TextInP .ui2RdDataAction .ui2RdDataAction #zField
Ms0 @TextInP .rdData2UIAction .rdData2UIAction #zField
Ms0 @TextInP .resExport .resExport #zField
Ms0 @TextInP .type .type #zField
Ms0 @TextInP .processKind .processKind #zField
Ms0 @AnnotationInP-0n ai ai #zField
Ms0 @TextInP .xml .xml #zField
Ms0 @TextInP .responsibility .responsibility #zField
Ms0 @RichDialogInitStart f0 '' #zField
Ms0 @RichDialogProcessEnd f1 '' #zField
Ms0 @PushWFArc f2 '' #zField
Ms0 @RichDialogProcessStart f3 '' #zField
Ms0 @GridStep f4 '' #zField
Ms0 @PushWFArc f5 '' #zField
Ms0 @RichDialogMethodStart f6 '' #zField
Ms0 @RichDialogProcessEnd f7 '' #zField
Ms0 @GridStep f9 '' #zField
Ms0 @PushWFArc f10 '' #zField
Ms0 @PushWFArc f8 '' #zField
Ms0 @RichDialogProcessEnd f11 '' #zField
Ms0 @PushWFArc f12 '' #zField
Ms0 @RichDialogProcessStart f13 '' #zField
Ms0 @RichDialogProcessEnd f14 '' #zField
Ms0 @GridStep f15 '' #zField
Ms0 @PushWFArc f16 '' #zField
Ms0 @PushWFArc f17 '' #zField
>Proto Ms0 Ms0 MailComposerProcess #zField
Ms0 f0 guid 146EB90F90637502 #txt
Ms0 f0 type ch.soreco.training.common.MailComposer.MailComposerData #txt
Ms0 f0 method start() #txt
Ms0 f0 disableUIEvents true #txt
Ms0 f0 inParameterDecl 'ch.ivyteam.ivy.richdialog.exec.RdMethodCallEvent methodEvent = event as ch.ivyteam.ivy.richdialog.exec.RdMethodCallEvent;
<> param = methodEvent.getInputArguments();
' #txt
Ms0 f0 outParameterDecl '<> result;
' #txt
Ms0 f0 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>start()</name>
    </language>
</elementInfo>
' #txt
Ms0 f0 86 54 20 20 13 0 #rect
Ms0 f0 @|RichDialogInitStartIcon #fIcon
Ms0 f1 type ch.soreco.training.common.MailComposer.MailComposerData #txt
Ms0 f1 86 150 20 20 13 0 #rect
Ms0 f1 @|RichDialogProcessEndIcon #fIcon
Ms0 f2 expr out #txt
Ms0 f2 96 74 96 150 #arcP
Ms0 f3 guid 146EDAC7345CD91F #txt
Ms0 f3 type ch.soreco.training.common.MailComposer.MailComposerData #txt
Ms0 f3 actionDecl 'ch.soreco.training.common.MailComposer.MailComposerData out;
' #txt
Ms0 f3 actionTable 'out=in;
' #txt
Ms0 f3 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>draftMail</name>
        <nameStyle>9,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ms0 f3 318 54 20 20 13 0 #rect
Ms0 f3 @|RichDialogProcessStartIcon #fIcon
Ms0 f4 actionDecl 'ch.soreco.training.common.MailComposer.MailComposerData out;
' #txt
Ms0 f4 actionTable 'out=in;
' #txt
Ms0 f4 actionCode 'import mailApplication.Mail;
import entity.MailData;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

FacesContext fc = FacesContext.getCurrentInstance();
MailData mailMB = fc.getApplication().evaluateExpressionGet(fc, "#{mailData}", MailData.class) as MailData;
	
Mail mail = new Mail();
mail.setIsDraft(true);
mail.setIsDeleted(false);
mail.setMailFrom(ivy.session.getSessionUser().getName());
mail.setMailTo(in.reciever);
mail.setMailSubject(in.subject);
mail.setMailContent(in.content);
mail.setSendDate(new DateTime());
mailMB.addNewMailToUser(ivy.session.getSessionUser(), mail);

in.reciever = null;
in.subject = null;
in.content = null;
in.allUsers.clear();' #txt
Ms0 f4 type ch.soreco.training.common.MailComposer.MailComposerData #txt
Ms0 f4 310 148 36 24 20 -2 #rect
Ms0 f4 @|StepIcon #fIcon
Ms0 f5 expr out #txt
Ms0 f5 328 74 328 148 #arcP
Ms0 f6 guid 146F09EB1612FD32 #txt
Ms0 f6 type ch.soreco.training.common.MailComposer.MailComposerData #txt
Ms0 f6 method autocompleteUser(String) #txt
Ms0 f6 disableUIEvents false #txt
Ms0 f6 inParameterDecl 'ch.ivyteam.ivy.richdialog.exec.RdMethodCallEvent methodEvent = event as ch.ivyteam.ivy.richdialog.exec.RdMethodCallEvent;
<java.lang.String name> param = methodEvent.getInputArguments();
' #txt
Ms0 f6 inParameterMapAction 'out.reciever=param.name;
' #txt
Ms0 f6 outParameterDecl '<List<java.lang.String> listUsers> result;
' #txt
Ms0 f6 outParameterMapAction 'result.listUsers=in.allUsers;
' #txt
Ms0 f6 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>autocompleteUsers</name>
        <nameStyle>17,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ms0 f6 182 54 20 20 13 0 #rect
Ms0 f6 @|RichDialogMethodStartIcon #fIcon
Ms0 f7 type ch.soreco.training.common.MailComposer.MailComposerData #txt
Ms0 f7 182 198 20 20 13 0 #rect
Ms0 f7 @|RichDialogProcessEndIcon #fIcon
Ms0 f9 actionDecl 'ch.soreco.training.common.MailComposer.MailComposerData out;
' #txt
Ms0 f9 actionTable 'out=in;
' #txt
Ms0 f9 actionCode 'import ch.ivyteam.ivy.security.IUser;
import mailApplication.Mail;
import entity.MailData;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

in.allUsers.clear();
FacesContext fc = FacesContext.getCurrentInstance();
MailData mailMB = fc.getApplication().evaluateExpressionGet(fc, "#{mailData}", MailData.class) as MailData;
	
for(IUser user : mailMB.getAllUsers()){
	if(in.reciever.length() > 0 && user.getName().indexOf(in.reciever) >= 0 && user.getName() != ivy.session.getSessionUser()){
		in.allUsers.add(user.getName());
	}
}
' #txt
Ms0 f9 type ch.soreco.training.common.MailComposer.MailComposerData #txt
Ms0 f9 174 148 36 24 20 -2 #rect
Ms0 f9 @|StepIcon #fIcon
Ms0 f10 expr out #txt
Ms0 f10 192 74 192 148 #arcP
Ms0 f8 expr out #txt
Ms0 f8 192 172 192 198 #arcP
Ms0 f11 type ch.soreco.training.common.MailComposer.MailComposerData #txt
Ms0 f11 318 198 20 20 13 0 #rect
Ms0 f11 @|RichDialogProcessEndIcon #fIcon
Ms0 f12 expr out #txt
Ms0 f12 328 172 328 198 #arcP
Ms0 f13 guid 146F0F613FDE7807 #txt
Ms0 f13 type ch.soreco.training.common.MailComposer.MailComposerData #txt
Ms0 f13 actionDecl 'ch.soreco.training.common.MailComposer.MailComposerData out;
' #txt
Ms0 f13 actionTable 'out=in;
' #txt
Ms0 f13 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>sendMail</name>
        <nameStyle>8,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ms0 f13 454 54 20 20 13 0 #rect
Ms0 f13 @|RichDialogProcessStartIcon #fIcon
Ms0 f14 type ch.soreco.training.common.MailComposer.MailComposerData #txt
Ms0 f14 454 198 20 20 13 0 #rect
Ms0 f14 @|RichDialogProcessEndIcon #fIcon
Ms0 f15 actionDecl 'ch.soreco.training.common.MailComposer.MailComposerData out;
' #txt
Ms0 f15 actionTable 'out=in;
' #txt
Ms0 f15 actionCode 'import mailApplication.Mail;
import entity.MailData;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;

FacesContext fc = FacesContext.getCurrentInstance();
MailData mailMB = fc.getApplication().evaluateExpressionGet(fc, "#{mailData}", MailData.class) as MailData;
	
Mail mail = new Mail();
mail.setIsDraft(false);
mail.setIsDeleted(false);
mail.setMailFrom(ivy.session.getSessionUser().getName());
mail.setMailTo(in.reciever);
mail.setMailSubject(in.subject);
mail.setMailContent(in.content);
mail.setSendDate(new DateTime());
mailMB.addNewMailToUser(ivy.session.getSessionUser(), mail);

in.reciever = null;
in.subject = null;
in.content = null;
in.allUsers.clear();' #txt
Ms0 f15 type ch.soreco.training.common.MailComposer.MailComposerData #txt
Ms0 f15 446 148 36 24 20 -2 #rect
Ms0 f15 @|StepIcon #fIcon
Ms0 f16 expr out #txt
Ms0 f16 464 74 464 148 #arcP
Ms0 f17 expr out #txt
Ms0 f17 464 172 464 198 #arcP
>Proto Ms0 .type ch.soreco.training.common.MailComposer.MailComposerData #txt
>Proto Ms0 .processKind HTML_DIALOG #txt
>Proto Ms0 -8 -8 16 16 16 26 #rect
>Proto Ms0 '' #fIcon
Ms0 f0 mainOut f2 tail #connect
Ms0 f2 head f1 mainIn #connect
Ms0 f3 mainOut f5 tail #connect
Ms0 f5 head f4 mainIn #connect
Ms0 f6 mainOut f10 tail #connect
Ms0 f10 head f9 mainIn #connect
Ms0 f9 mainOut f8 tail #connect
Ms0 f8 head f7 mainIn #connect
Ms0 f4 mainOut f12 tail #connect
Ms0 f12 head f11 mainIn #connect
Ms0 f13 mainOut f16 tail #connect
Ms0 f16 head f15 mainIn #connect
Ms0 f15 mainOut f17 tail #connect
Ms0 f17 head f14 mainIn #connect
